﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" AutoEventWireup="true"
    CodeBehind="Devolver.aspx.cs" Inherits="Locadora.Views.Filme.Editar" %>

<asp:Content ID="aboutContent" ContentPlaceHolderID="MainContent" runat="server">
    <script src="../../Content/javascript/prototype.js" type="text/javascript"></script>
    <script src="../../Content/javascript/stars.js" type="text/javascript"></script>    
    <div class="corpo">
    <h2>
        Devolver Filme</h2>
        <div class="notes">
            <h4>
                Informações</h4>
            <p>
                Please enter your full email address, for example, <strong>name@domain.com</strong></p>
            <p>
                It is important that you provide a valid, working email address that you have access
                to as it must be verified before you can use your account.</p>
            <p>
                Please enter a land line number, not a mobile phone number.</p>
            <p class="last">
                Your phone number will not be shared or used for telemarketing. Your information
                is protected by our <a title="View our Privacy Policy" href="http://jeffhowden.com/legal/privacy_policy/">
                    Privacy Policy</a>.</p>
        </div>
         <form action="/Filme/Devolve/<%= ViewData["Id"] %>">
        <% if (ViewData["ErrorMessage"] != null)
           { %>
           <p class=erro>
        Ocorreu um erro:
        <br />
        <%= ViewData["ErrorMessage"] %>
        </p>
        <br />
        <% } %>
        <table border=0 class=list cellpadding=0 cellspacing=0>
            <tr>
                <td>
                    Título:
                </td>
            
                <td>
                    <%= ViewData["Titulo"] %>
                </td>
            </tr>
            <tr>
                <td>
                    Ator:
                </td>
            
                <td>
                    <%= ViewData["Ator"] %>
                </td>
            </tr>
            <tr>
                <td>
                    Diretor:
                </td>
            
                <td>
                    <%= ViewData["Diretor"] %>
                </td>
            </tr>
            <tr>
                <td>
                    Duração:
                </td>
            
                <td>
                    <%= ViewData["Duracao"] %>
                </td>
            </tr>
            <tr>
                <td>
                    Nota:
                </td>            
                <td>
                    <% for (int i = 0; i < int.Parse(ViewData["Nota"].ToString()); i++)
                    { %>
                    <img src="../../Content/images/star10x10.gif" />
                    <%} %>
                    <input type=hidden name=notaAtual value="<%= ViewData["Nota"] %>" />
                    <input type=hidden name=quantidade value="<%= ViewData["Quantidade"] %>" />
                </td>
            </tr>
            <tr>
                <td>
                    Tipo Mídia:
                </td>            
                <td>
                    <%= ViewData["Tipo"] %>
                </td>
            </tr>
            <tr>
                <td>
                    Data Locação:
                </td>            
                <td>
                    <%= DateTime.Now.ToShortDateString() %>
                </td>
            </tr>
            <tr>
                <td>
                    Data Devolução:
                </td>            
                <td>
                    <%= DateTime.Now.AddDays(5).ToShortDateString() %>
                </td>
            </tr>
        
        
        <tr><td colspan=2>Comentários:</td></tr>
        <tr><td colspan=3> <textarea  name="comentario" cols=40 rows="5"></textarea></td></tr>
        <tr><td colspan=2>Sua nota:</td></tr>
        <tr><td colspan=2>
        <input type="radio" name="nota" onclick="setStarValue(1)" value=1/>1
        <input type="radio" name="nota" onclick="setStarValue(2)" value=2/>2
        <input type="radio" name="nota" onclick="setStarValue(3)" value=3/>3
        <input type="radio" name="nota" onclick="setStarValue(4)" value=4/>4
        <input type="radio" name="nota" onclick="setStarValue(5)" value=5/>5
<script type="text/javascript">
										function setStarValue(val) {
											window.s7.setValue(val, false);
										}
										function uncalledCallBack(val)
										{
											//alert('was called anyway');
										}
										var s7 = new Stars({
											maxRating: 5,
											imagePath: '../../Content/images/',
											callback: uncalledCallBack
										});
									</script>
        
        </td></tr>
        
            <tr>
                <td colspan="2">
                    <!-- <input type="hidden" name="coUsuario" value="<%= Session["CO_USUARIO"] %>" /> -->
                    <input type="hidden" name="coUsuario" value="<%= (Membership.GetUser(Page.User.Identity.Name)).ProviderUserKey.ToString()%>" />
                    <input type="hidden" name="coLocacao" value="<%= ViewData["CoLocacao"] %>" />
                    <input type="submit" value="Devolver" />
                </td>
            </tr>
            
        </table>
        </form>
    </div>
        <script type="text/javascript">
            document.getElementById("comentario").focus();
        </script>
</asp:Content>
